package com.neusoft.yuejian12.yuejian_12.activity;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;

import com.neusoft.yuejian12.yuejian_12.R;
public class HelloActivity extends AppCompatActivity {


    private Button loginBtn;
    private Button regBtn;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_hello);
        initViews();
        initEvents();
    }
    public void  initViews(){
        loginBtn = (Button) findViewById(R.id.LoginBtn);
        regBtn = (Button) findViewById(R.id.RegBtn);
    }
    public void initEvents(){
        loginBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent();
                intent.setClass(HelloActivity.this,LoginActivity.class);
                startActivityForResult(intent,1);
            }
        });
        regBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent();
                intent.setClass(HelloActivity.this, RegisterActivity.class);
                startActivityForResult(intent,2);
            }
        });

    }
}
